package ore.example.pokemoninfo.command;

import ore.example.pokemoninfo.GUI.PokemonInfoGUI;
import ore.example.pokemoninfo.GUI.PokemonTradeGui;
import ore.example.pokemoninfo.utils.TradeEvolutionFinder;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

public class Tradeinfo implements CommandExecutor {

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("§c只有玩家才能使用这个命令!");
            return true;
        }
        Player player = (Player) sender; // ✅ 强制转换
        PokemonTradeGui.open(player);     // ✅ 传入 Player
        return true;
    }
}
